<template>
  <j-modal
      :title="title"
      :width="width"
      :visible="visible"
      switchFullscreen
      @ok="handleOk"
      :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
      @cancel="handleCancel"
      cancelText="关闭">
    <div>
      <a-table
          ref="table"
          size="middle"
          bordered
          rowKey="id"
          class="j-table-force-nowrap common-table"
          :rowSelection="{type:'radio',selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
          :scroll="{ x: true }"
          :columns="columns"
          :dataSource="dataSource"
          :pagination="ipagination"
          :loading="loading"
          @change="handleTableChange"
      >
      </a-table>
    </div>
  </j-modal>
</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'

export default {
  mixins: [JeecgListMixin],
  data () {
    return {
      title:'',
      width:1000,
      visible: false,
      disableSubmit: false,
      type:'',
      columns: [
        {
          title: '工号',
          dataIndex: 'jobNo',
          align: 'center'
        },
        {
          title: '姓名',
          dataIndex: 'name',
          align: 'center'
        },
        {
          title: '性别',
          dataIndex: 'sex_dictText',
          align: 'center'
        },
        {
          title: '班次',
          dataIndex: 'shift_dictText',
          align: 'center'
        },
        {
          title: '工序',
          dataIndex: 'workingProcedure_dictText',
          align: 'center'
        },
        {
          title: '工种',
          dataIndex: 'workType',
          align: 'center'
        },
      ],
      url: {
        list: '/crm_personnel/crmPersonnel/list', //查询列表
      }
    }
  },
  methods: {
    add (type) {
      this.visible=true
      this.type = type
    },
    handleOk () {
      this.$emit('modalFormOk',{type:this.type,data:this.selectionRows[0]})
      this.visible=false
    },
    handleCancel () {
      this.visible=false
    }
  }
}
</script>